package com.shiyuanshenghong.web.controller.protraitsofpoorhoseholdscontroller;

import com.shiyuanshenghong.service.portraitsofpoorhoseholdsservice.PortraitsOfPoorHouseholdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by LZQ on 2017/12/18.
 */

@RestController
@RequestMapping("/poverty")
public class PortraitsOfPoorsHoseholdsController {

    @Autowired
    private PortraitsOfPoorHouseholdsService portraitsOfPoorHouseholdsService;

    @GetMapping("/portray")
    public Map<String,Map> distributionOfPoorThermal(){
        Map<String,Map> mapTotal=new HashMap<>();
        mapTotal.put("poorThermal",portraitsOfPoorHouseholdsService.distributionOfPoorThermal());
        mapTotal.put("povertyCauses",portraitsOfPoorHouseholdsService.distributionOfPovertyCauses());
        mapTotal.put("educationDistribution",portraitsOfPoorHouseholdsService.distributionOfEducationalBackground());
        mapTotal.put("povertyAttribute",portraitsOfPoorHouseholdsService.distributionOfPovertyAttribute());
        mapTotal.put("incomePictures",portraitsOfPoorHouseholdsService.distributionOfIncomePictureOfPoorHouseholds());
        mapTotal.put("poorPopulation",portraitsOfPoorHouseholdsService.distributionOfTypeOfPoorPopulation());
        mapTotal.put("poorHousing",portraitsOfPoorHouseholdsService.distributionOfPoorHouseholdsOfHousing());
        return mapTotal;
    }



}
